(function(){
	$( "#pb_tabs" ).tabs({ 
		active: 0,
		//fx: { height: 'toggle', opacity: 'toggle'},
		selected: -1,
		collapsible: true
	});
	$( "#dateFrom, #dateTo" ).datepicker().datepicker("setDate","+0");
	$("#myTable").tablesorter(); 
}());
function searchData()
{
	var dateFrom = $("#dateFrom").val();
	var dateTo = $("#dateTo").val();
	var callType = $("#combobox").val();
	var msisdn = $("#msisdn").val();

	$.get("searchData?dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&callType=" + callType + "&msisdn=" + msisdn, function(data) {
		  $('#myDiv').html(data);
		  $("#myTable").tablesorter( {sortList: [[1,0]]} );
		});
}
function uploadFile() {
	var file = document.getElementById('fileToUpload').files[0];
	var data = new FormData();
	data.append("file", file);
	var xmlhttp;
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	} else {// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			$('#result').html(xmlhttp.responseText);
    	}
	}

	xmlhttp.open('POST', 'uploadData', true);
	xmlhttp.send(data);
}